package com.baosight.sczx.common.zm.cInterface.cm;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baosight.iplat4j.core.spring.SpringApplicationContext;
import com.baosight.iplat4j.dao.Dao;

/**
 * 物资分类
 * <p>Title: MaterialType.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 杨鸣
 * @version 1.0
 * <pre>Histroy:
 *          2011-6-1 下午05:20:13  杨鸣  Create
 *</pre>
 */
public class MaterialBaseHis {
	
	private static Dao dao = (Dao)SpringApplicationContext.getBean("dao");
		
	/**
	 * 给隐患处理结果插入数据
	 * <p>Function: getRiskStatus</p>
	 * <p>Description: </p>
	 * <p>return value:EiInfo</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *     2011-6-14下午05:23:30 高强
	 * </p>
	 *
	 */
	public static boolean InsertDataTORiskResult(String resultKey,String recordKey){ 
		Map<String, String> _args = new HashMap<String, String>();
		_args.put("fdKeyId", resultKey);
		_args.put("fdRiskrecordId", recordKey);
		_args.put("fdIsPenalty", "否");
		_args.put("fdStatus", "待处理");
		_args.put("fdIsGuide", "否");
		_args.put("fdGuideStatus", "未批示");
		_args.put("fdRecheckFinish", "否");
		try {
			 dao.insert("ZMCLRiskResult.insert", _args);

		} catch (Exception e) {
			return false;
			
		}
		return true;
	}
	
	/**
	 * 获得最大的结转月份，物资调价模块
	 * <p>Function: getAutoBaseMonth</p>
	 * <p>Description: </p>
	 * <p>return List</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *     2011-9-14下午05:23:30 张坤
	 * </p>
	 *
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static List<Map> getAutoBaseMonth(String sqlName , Map<String, String> params){
		List<Map> _list = new ArrayList<Map>();
		try {
			_list = dao.query("ZMCMMaterialBaseHis.autoBaseMonth", params);
		} catch (Exception e) {
			return _list;
		}
		return _list;
	}
	
}
